<?php

class HouseStyle extends EMongoDocument {
// class HouseStyle extends EMongoEmbeddedDocument {
public $hsId;
public $description;
public $houseType;
public $roomStyles;

public function getCollectionName() {
    return 'HouseStyle';
  }
  
    /**
   * This method have to be defined in every model, like with normal CActiveRecord
   */
public static function model($className = __CLASS__) {
    return parent :: model($className);
  }

public static function findById($id){
	$id = new MongoId ( $id );
    return self::model()->findByAttributes(array('_id'=>$id));
	
} 
  
public static function findByHsId($HsId){
    return self::model()->findByAttributes(array('hsId'=>$HsId));
}

  public static function getCount(){
    return self::model()->count();
  }
  
public static function findAllObject(){
    return self::model()->findAll();
  }

public  function findByHouseType($houseType){
    return self::model()->findAllByAttributes(array('houseType'=>$houseType));
  }
}
?>
  